﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using QLTV.Public;

namespace QLTV.DAL
{
    public class DangNhapDAL
    {
        ConnectionData connect;
        public DataTable CheckDangNhap(DangNhapDTO p)
        {
            try
            {
                connect = new ConnectionData();
                int Nparameter = 2;
                string[] name = new string[Nparameter];
                object[] value = new object[Nparameter];

                name[0] = "@TenDangNhap";
                value[0] = p.TenDangNhap;
                name[1] = "@MatKhau";
                value[1] = p.MatKhau;
                return connect.GetData("DANGNHAP_KiemTra", name, value, Nparameter);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
    }
}
